﻿@{
	ViewBag.Title = "选择客户";
	ViewBag.HideSidebar = true;
}

<div class="col-xs-12 col-sm-12 col-md-10 col-md-offset-1 customer-selector">
	<div class="panel panel-default main">
		<div class="panel-heading">
			<h3 class="panel-title">请选择需要查看的客户</h3>
			<form class="form-inline pull-right hidden-xs">
				<div class="form-group">
					<input type="text" class="form-control hidden" id="customer-quick-query" placeholder="快速搜索">
				</div>
				<button type="submit" id="customer-quick-query-btn" class="button button-primary button-rounded button-tiny" onclick="m.customer.quickQuery(); return false;"><i class="fa fa-search"></i></button>
				<button type="button" data-trigger="tooltip" data-content="新增TFS客户" data-position="s" id="customer-new-btn" class="button button-primary button-rounded button-tiny" onclick="m.customer.openNew();"><i class="fa fa-plus"></i></button>
			</form>
		</div>
		<div class="panel-body">
			<!--搜索结果区域-->
			<div class="panel panel-success" id="customer-quick-query-panel">
				<div class="panel-heading">
					<h3 class="panel-title">搜索结果</h3>
				</div>
				<div class="panel-body">
					<div class="row" id="customer-quick-query-row">
						
					</div>
				</div>
			</div>
			<!--选择的历史记录-->
			<div class="panel panel-info" id="customer-recent-panel">
				<div class="panel-heading">
					<h3 class="panel-title">最近浏览 <i class="fa fa-spinner fa-spin"></i></h3>
				</div>
				<div class="panel-body">
					<div class="row" id="customer-recent-panel-row">
					</div>
				</div>
			</div>
			<!--区域/客户集合-->
			@{
				foreach (var area in this.Model.Areas)
				{
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3 class="panel-title">
								<a role="button" data-toggle="collapse" href="#collapse-@area.AreaShortName" aria-expanded="false" aria-controls="collapse-@area.AreaShortName">
									@area.AreaName <i class="fa"></i>
								</a>
							</h3>

						</div>
						<div class="panel-body collapse in" id="collapse-@area.AreaShortName" area-code="@area.AreaShortName" area-id="@area.AreaGUID">

							@foreach (var custom in area.Customs)
							{
								<div class="col-xs-6 col-sm-4 col-md-2 customer-item">
									<a href="/Dashboard/@custom.CustomShortName" code="@custom.CustomShortName" title="@custom.CustomName">
										<img class="img-circle" src="/Content/images/customer-logo/@{@custom.CustomShortName}.jpg" onerror="this.src = '/Content/images/logo_a.jpg'" />
										@custom.CustomName
									</a>
								</div>
							}

						</div>
					</div>
				}
			}

		</div>
	</div>
</div>

@section scripts{
	<script type="text/javascript">
		$(document).ready(function () {
			m.customer.init("@ViewBag.ReturnUrl");
		});
	</script>
}

